<?php
$first_id = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '积分商城',
    'router'      => '',
    'icon'        => 'layui-icon-cart',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => '',
    'action'      => '',
    'create_time' => time()
]);

$first_id_1 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '商品列表',
    'parent_id'   => $first_id,
    'router'      => "{$mg_module}/Product/index",
    'icon'        => '',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Product',
    'action'      => 'index',
    'create_time' => time(),
    'style'       => 'layui-btn-sm'
]);

$first_id_2 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '添加商品',
    'parent_id'   => $first_id_1,
    'router'      => "{$mg_module}/Product/add",
    'icon'        => 'layui-icon-add-1',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Product',
    'action'      => 'add',
    'create_time' => time(),
    'style'       => 'layui-btn-sm layui-btn-normal'
]);

$first_id_3 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '编辑商品',
    'parent_id'   => $first_id_1,
    'router'      => "{$mg_module}/Product/edit",
    'icon'        => 'layui-icon-edit',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Product',
    'action'      => 'edit',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-normal'
]);

$first_id_4 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '删除商品',
    'parent_id'   => $first_id_1,
    'router'      => "{$mg_module}/Product/del",
    'icon'        => 'layui-icon-delete',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Product',
    'action'      => 'del',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-danger'
]);

$first_id_5 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '兑换记录',
    'parent_id'   => $first_id,
    'router'      => "{$mg_module}/Product/exchange",
    'icon'        => 'layui-icon-delete',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Product',
    'action'      => 'exchange',
    'create_time' => time(),
    'style'       => ''
]);

$first_id_6 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '审核通过',
    'parent_id'   => $first_id_5,
    'router'      => "{$mg_module}/Product/verify",
    'icon'        => 'layui-icon-ok',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Product',
    'action'      => 'verify',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-normal'
]);

$first_id_7 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '审核拒绝',
    'parent_id'   => $first_id_5,
    'router'      => "{$mg_module}/Product/refund",
    'icon'        => 'layui-icon-close',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Product',
    'action'      => 'refund',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-danger'
]);

$first_id_7 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '审核拒绝',
    'parent_id'   => $first_id_5,
    'router'      => "{$mg_module}/Product/deliver",
    'icon'        => 'layui-icon-email',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Product',
    'action'      => 'deliver',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-normal'
]);



